﻿using MySqlConnector;

namespace Front._1117;

public partial class Form1 : Form
{
    public Form1()
    {
        InitializeComponent();
    }


    private void button1_Click(object sender, EventArgs e)
    {
        throw new System.NotImplementedException();
    }

    private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
    {
        // 事件逻辑
    }

    private void Form1_Load(object sender, EventArgs e)
    {
        // 事件逻辑
    }

    private void button2_Click(object sender, EventArgs e)
    {
        using var connection = new MySqlConnection("Server=myserver;User ID=mylogin;Password=mypass;Database=mydatabase");
        connection.Open();

        using var command = new MySqlCommand("SELECT field FROM table;", connection);
        using var reader = command.ExecuteReader();
        while (reader.Read())
            Console.WriteLine(reader.GetString(0));

    }
}